import Router from '@koa/router';
import AuditLogController from '@/controllers/AuditLogController';
import { auth, requirePermission } from '@/middlewares';
import { PermissionAction } from '@/types';

const router = new Router({
  prefix: '/api/audit-logs',
});

/**
 * 审计日志路由
 */

// 获取审计日志列表
router.get('/', auth, requirePermission('audit_log', PermissionAction.READ), AuditLogController.list.bind(AuditLogController));

// 获取操作统计
router.get('/stats', auth, requirePermission('audit_log', PermissionAction.READ), AuditLogController.stats.bind(AuditLogController));

// 获取审计日志详情
router.get('/:id', auth, requirePermission('audit_log', PermissionAction.READ), AuditLogController.detail.bind(AuditLogController));

export default router;

